#include "provider_api.h"

std::map<std::string, FsCreateFunc> *FilesystemProvider::KnownFsList;

void FilesystemProvider::RegisterFs(const char *name, FsCreateFunc func)
{
	if(!KnownFsList)
		KnownFsList = new std::map<std::string, FsCreateFunc>();
	(*KnownFsList)[name] = func;
}

FsCreateFunc FilesystemProvider::LookupFs(const std::string& name)
{
	if(!KnownFsList)
		return NULL;
	std::map<std::string, FsCreateFunc>::iterator it = KnownFsList->find(name);
	return it == KnownFsList->end() ? NULL : it->second;
}
